package decorator.decorator;

import decorator.Drink;

/**
 * Created by IntelliJ
 * Author:熊磊
 */

// 装饰者，可以给构件对象添加功能
public abstract class Decorator extends Drink {
    private Drink obj;
    @Override
    public float cost() {
        return super.getPrice()+obj.cost();
    }

    public Decorator(Drink obj) {
        this.obj = obj;
    }

    @Override
    public String getDes() {
        return super.getDes()+""+"&&"+obj.getDes();
    }
}
